var islog=false;
var domainnums;
var rands;
theDomain = new Array();

var xsu_t;
if ((xsu_t == null) || (xsu_t == "") || (xsu_t > 10)) { xsu_t = 2; }
if ((xsu_t == 0) || (xsu_t == '0')) { xsu_t = 720; }
var xsu_tt = xsu_t * 60 * 1000;

domainnums = 1;
theDomain[0] = "www.sohu.com.xsu.cc"
theDomain[1] = "c.xsu.cc"


if (domainnums > 1) {
    rands = Math.round(Math.random() * domainnums)
    while (rands > (domainnums - 1)) {
        rands = Math.round(Math.random() * domainnums)
    }
} else { rands = 0 }

if (rands == "") { rands = 0 }
var codedomain = theDomain[rands]

if ((xsu_width != '300') && (xsu_width != '250')) { xsu_width = '300'; }
if ((xsu_height != '240') && (xsu_height != '200')) { xsu_height = '250'; }

var xsu_location = window.location.href
var xsu_from_url;
try { xsu_from_url = window.top.document.referrer; }
catch (err)
{ xsu_from_url = document.referrer; };
var gook=true;
if (xsu_userid != "0")
    if (self != top) {
    var xsukeshibody;
    xsukeshibody = document.documentElement;
      if (eval(xsukeshibody.clientWidth) <= 0) {
        document.writeln("<body></body>");
        xsukeshibody = document.body;
      }
       if ((xsukeshibody.clientWidth <= (parseInt(xsu_width) + 1000)) || (xsukeshibody.clientHeight <= (parseInt(xsu_height) + 760)))
        {
	gook=false;
	top.location = self.location;
	}
    }
 

xsu_location = encodeURIComponent(xsu_location);
xsu_from_url = encodeURIComponent(xsu_from_url);

var xsu_encodes = xsu_encode;
var xsu_widths = '300';
var xsu_heights = '250';
var xsu_userids = xsu_userid;
var xsu_subids = xsu_subid;
var xsu_logos = xsu_logo;
var xsu_exids = xsu_exid;
var ImgUrl = ""
if (gook==true)
ImgUrl="http://" + codedomain + "/m1.ashx?w=" + xsu_userids + "&sid=" + xsu_subids + "&logo=" + xsu_logos + "&e=" + xsu_encodes + "&furl=" + xsu_location + "&ffurl=" + xsu_from_url;
else
ImgUrl="http://js.xsu.cc/?uid="+xsu_userid;
 


var xsu_fm_url = ImgUrl;
var xsu_fm_width = xsu_widths;
var xsu_fm_height = xsu_heights;
var xsu_fm_close_left = 16;
var xsu_fm_domain_left = 77; var xsu_fm_domain_top = 15;
if (typeof (__hasxsufmt) == 'undefined' && navigator.cookieEnabled) {
    ; (function() {
        var a = {};
        var d = navigator.userAgent;
        this.DebugMode = null;
        this.FloatDiv = null;
        this.Timer = null;
        this.TimerDiv = null;
        this.isfixed = false;
        a.ver = {
            ie: /MSIE/.test(d),
            ie6: !/MSIE 7\.0/.test(d) && (/MSIE 6\.0/.test(d) || /MSIE 5\.0/.test(d)) && !/MSIE 8\.0/.test(d) && !/MSIE 9\.0/.test(d),
            isie789: /MSIE 7\.0/.test(d) || /MSIE 8\.0/.test(d) || /MSIE 9\.0/.test(d),
            isfixed: /Firefox\/8/.test(d) || /Firefox\/7/.test(d) || /Firefox\/6/.test(d) || /Firefox\/5/.test(d) || /Firefox\/4/.test(d) || /Firefox\/3/.test(d) || /WebKit/.test(d)
        };
        a.init = function() {
            this.isfixed = false;
            if (a.ver.isfixed) this.isfixed = true;
            else if (a.ver.isie789 && document.compatMode != "BackCompat") this.isfixed = true;
              if(islog)
              {

            if (a.ver.ie6) img = '<img style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://js.xsu.cc/images/logo-2.png,sizingMethod=image);" src="http://js.xsu.cc/images/logo-1.png" width=77px height=15px border=0/>';
            else img = '<img src="http://js.xsu.cc/images/logo-2.png" width=77px height=15px border=0/>';}
            else 
            img="";

            if (this.isfixed) document.write('<div id="__xsu_fm_Div" style="position:fixed; z-index: 2147483647;width:' + xsu_fm_width + 'px;height:' + xsu_fm_height + 'px;bottom:0;right:0;">');
            else document.write('<div id="__xsu_fm_Div" style="position:absolute; z-index: 2147483647;width:' + xsu_fm_width + 'px;height:' + xsu_fm_height + 'px;">');
            document.write('<div id="__xsu_fm_Close" style="z-index:199999; top:3px;left:' + (xsu_fm_width - xsu_fm_close_left - 3) + 'px; width:16px; height:16px; position:absolute; display:none;" onClick="javascript:_xsu_richmedia.close();"><img style="width:14px; height:14px;" src="http://js.xsu.cc/images/close.png"></div>');
            document.write('<div id="__xsu_fm_Logo" style="z-index:199998; top:' + (xsu_fm_height - xsu_fm_domain_top) + 'px;left:' + (xsu_fm_width - xsu_fm_domain_left) + 'px; width:78px; height:17px; position:absolute; display:;"><a href=http://www.xsu.cc target=_blank>' + img + '</a></div>');
            document.write('<iframe id="__xsu_fm_Frame" name="__xsu_fm_Frame" src="about:blank" marginwidth=0 marginheight=0  hspace=0 vspace=0 frameborder=0 scrolling=no width=' + xsu_fm_width + ' height=' + xsu_fm_height + ' allowTransparency="true"></iframe>');
            document.write('<div id="__xsu_fm_Count" style="z-index:199994; top:0px;left:0px; width:0px; height:0px; position:absolute; display:none;"></div>');
            document.write('</div>');
            this.FloatDiv = document.getElementById('__xsu_fm_Div').style;
            document.getElementById('__xsu_fm_Frame').src = xsu_fm_url;
            setTimeout(function() { document.getElementById('__xsu_fm_Close').style.display = ""; }, 2000);
        }
        a.open = function() {
            this.init();
            this.DebugMode = "status1";
            this.TimerDiv = setInterval("_xsu_RichMedia_CheckDivIsTop('__xsu_fm_Div')", 1000);
            if (!this.isfixed) try { window.onscroll = _xsu_RichMedia_ScrollFollow; } catch (e) { this.close(); }
            if (!this.isfixed) this.Timer = setInterval("_xsu_RichMedia_ScrollFollow()", 50);
            if (!this.isfixed) _xsu_RichMedia_ScrollFollow();
        }
        a.close = function() {
            document.getElementById('__xsu_fm_Frame').src = "about:blank";
            //clearInterval(this.Timer);
            //clearInterval(this.TimerDiv);
            //window.onscroll = null;
            this.FloatDiv.display = 'none';
            document.getElementById('__xsu_fm_Count').innerHTML = '<img src="http://' + codedomain + '/tt.ashx?m=4" width=0 height=0 style="display:none;" border=0/>';

            setTimeout(function() { document.getElementById('__xsu_fm_Div').style.display = "inline"; document.getElementById('__xsu_fm_Frame').src = xsu_fm_url; }, xsu_tt)

        }
        a.scrollfllow = function(ev) {
            var obj = (document.compatMode.toLowerCase() == "css1compat") ? document.documentElement : document.body
            this.FloatDiv.top = obj.scrollTop + obj.clientHeight - xsu_fm_height - 3 + 'px';
            this.FloatDiv.left = obj.scrollLeft + obj.clientWidth - xsu_fm_width - 3 + 'px';
            this.debug(obj.scrollTop, obj.scrollLeft, obj.clientWidth, obj.clientHeight);
        }
        a.istop = function(ev) {
            var divs = document.getElementsByTagName("div");
            var len = divs.length;
            for (var i = 0; i < len; i++) {
                if (divs[i].id == ev) { divs[i].style.zIndex = 2147483647; }
                if (divs[i].style.zIndex == 2147483647 && divs[i].id != ev) { divs[i].style.zIndex--; }
            }
        }
        a.debug = function(argScrollTop, argScrollLeft, argclientWidth, argclientHeight) {
            arg = "#" + " clientWidth:" + argclientWidth + " clientHeight:" + argclientHeight + " ScrollTop:" + argScrollTop + " ScrollLeft:" + argScrollLeft + "      Time:" + new Date().toLocaleString();
            if (this.DebugMode == "alert") { alert(arg.toString()); }
            if (this.DebugMode == "status") { window.status = arg.toString(); document.title = arg.toString(); }
        }
        _xsu_RichMedia_ScrollFollow = function(ev) { _xsu_richmedia.scrollfllow(ev); }
        _xsu_RichMedia_CheckDivIsTop = function(ev) { _xsu_richmedia.istop(ev); }
        window._xsu_richmedia = a;
    })();
    _xsu_richmedia.open();
    var __hasxsufmt = 1;
}


